import appConfig from "../config/config";
import {Locale} from "vue-i18n";
import {Machine, Printer, Settings, Store, Location} from "@/types/mutations";
import {UserInfo} from "@/types/user";

export interface State {
    locale: Locale,
    systemInfo: object,
    bgColor: String,
    appbarColor: String,
    primaryColor: String,
    isLogin: Boolean,
    showLogin: boolean,
    loadingText: any,
    loading: boolean,
    userInfo: UserInfo,
    showVip: boolean,
    token: string,
    printer: Printer,
    store: Store,
    machine: Machine,
    location: Location,
    machineOnline: number
    settings: Settings,
}

const state: State = {
    locale: appConfig.getLang(),
    bgColor: "#0C0C0C",
    systemInfo: uni.getSystemInfoSync(),
    appbarColor: "#1c1c1e",
    primaryColor: "#007aff",
    loading: false,
    loadingText: null,
    showVip: false,
    showLogin: false,
    isLogin: appConfig.getToken(),
    token: appConfig.getToken(),
    userInfo: {} as UserInfo,
    location: {} as Location,
    printer: {} as Printer,
    store: {} as Store,
    machine: {} as Machine,
    machineOnline: 0,
    settings: {} as Settings,
}

export default state;
